Optimal. Leaf size=111 \[ -\frac {b^3}{2 a^2 (a+b)^2 f \left (b+a \cos ^2(e+f x)\right )}-\frac {\csc ^2(e+f x)}{2 (a+b)^2 f}-\frac {b^2 (3 a+b) \log \left (b+a \cos ^2(e+f x)\right )}{2 a^2 (a+b)^3 f}-\frac {(a+3 b) \log (\sin (e+f x))}{(a+b)^3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4223, 457, 90}
\begin {gather*} -\frac {b^3}{2 a^2 f (a+b)^2 \left (a \cos ^2(e+f x)+b\right )}-\frac {b^2 (3 a+b) \log \left (a \cos ^2(e+f x)+b\right )}{2 a^2 f (a+b)^3}-\frac {\csc ^2(e+f x)}{2 f (a+b)^2}-\frac {(a+3 b) \log (\sin (e+f x))}{f (a+b)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 457
Rule 4223
Rubi steps
\begin {align*} \int \frac {\cot ^3(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=-\frac {\text {Subst}\left (\int \frac {x^7}{\left (1-x^2\right )^2 \left (b+a x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\text {Subst}\left (\int \frac {x^3}{(1-x)^2 (b+a x)^2} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {1}{(a+b)^2 (-1+x)^2}+\frac {a+3 b}{(a+b)^3 (-1+x)}-\frac {b^3}{a (a+b)^2 (b+a x)^2}+\frac {b^2 (3 a+b)}{a (a+b)^3 (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {b^3}{2 a^2 (a+b)^2 f \left (b+a \cos ^2(e+f x)\right )}-\frac {\csc ^2(e+f x)}{2 (a+b)^2 f}-\frac {b^2 (3 a+b) \log \left (b+a \cos ^2(e+f x)\right )}{2 a^2 (a+b)^3 f}-\frac {(a+3 b) \log (\sin (e+f x))}{(a+b)^3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.47, size = 130, normalized size = 1.17 \begin {gather*} -\frac {(a+2 b+a \cos (2 (e+f x)))^2 \left ((a+b) \csc ^2(e+f x)+2 (a+3 b) \log (\sin (e+f x))+\frac {b^2 \left (\frac {2 b (a+b)}{a+2 b+a \cos (2 (e+f x))}+(3 a+b) \log \left (a+b-a \sin ^2(e+f x)\right )\right )}{a^2}\right ) \sec ^4(e+f x)}{8 (a+b)^3 f \left (a+b \sec ^2(e+f x)\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 141, normalized size = 1.27
method | result | size |
derivativedivides | \(\frac {-\frac {b^{2} \left (\frac {\left (a +b \right ) b}{a^{2} \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}+\frac {\left (3 a +b \right ) \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{a^{2}}\right )}{2 \left (a +b \right )^{3}}+\frac {1}{4 \left (a +b \right )^{2} \left (\cos \left (f x +e \right )-1\right )}+\frac {\left (-a -3 b \right ) \ln \left (\cos \left (f x +e \right )-1\right )}{2 \left (a +b \right )^{3}}-\frac {1}{4 \left (a +b \right )^{2} \left (1+\cos \left (f x +e \right )\right )}+\frac {\left (-a -3 b \right ) \ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{3}}}{f}\) | \(141\) |
default | \(\frac {-\frac {b^{2} \left (\frac {\left (a +b \right ) b}{a^{2} \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}+\frac {\left (3 a +b \right ) \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{a^{2}}\right )}{2 \left (a +b \right )^{3}}+\frac {1}{4 \left (a +b \right )^{2} \left (\cos \left (f x +e \right )-1\right )}+\frac {\left (-a -3 b \right ) \ln \left (\cos \left (f x +e \right )-1\right )}{2 \left (a +b \right )^{3}}-\frac {1}{4 \left (a +b \right )^{2} \left (1+\cos \left (f x +e \right )\right )}+\frac {\left (-a -3 b \right ) \ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{3}}}{f}\) | \(141\) |
risch | \(-\frac {i x}{a^{2}}+\frac {2 i a x}{a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}}+\frac {2 i a e}{f \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}+\frac {6 i b x}{a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}}+\frac {6 i b e}{f \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}+\frac {6 i b^{2} x}{a \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}+\frac {6 i b^{2} e}{f a \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}+\frac {2 i b^{3} x}{a^{2} \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}+\frac {2 i b^{3} e}{f \,a^{2} \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}+\frac {2 a^{3} {\mathrm e}^{6 i \left (f x +e \right )}-2 b^{3} {\mathrm e}^{6 i \left (f x +e \right )}+4 a^{3} {\mathrm e}^{4 i \left (f x +e \right )}+8 a^{2} b \,{\mathrm e}^{4 i \left (f x +e \right )}+4 b^{3} {\mathrm e}^{4 i \left (f x +e \right )}+2 a^{3} {\mathrm e}^{2 i \left (f x +e \right )}-2 b^{3} {\mathrm e}^{2 i \left (f x +e \right )}}{a^{2} f \left (a +b \right )^{2} \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) a}{f \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b}{f \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}-\frac {3 b^{2} \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +2 b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a}+1\right )}{2 f a \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}-\frac {b^{3} \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +2 b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a}+1\right )}{2 f \,a^{2} \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right )}\) | \(616\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 197, normalized size = 1.77 \begin {gather*} -\frac {\frac {{\left (3 \, a b^{2} + b^{3}\right )} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3}} + \frac {{\left (a + 3 \, b\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}} - \frac {a^{3} + a^{2} b - {\left (a^{3} - b^{3}\right )} \sin \left (f x + e\right )^{2}}{{\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} \sin \left (f x + e\right )^{4} - {\left (a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3}\right )} \sin \left (f x + e\right )^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 321 vs.
\(2 (109) = 218\).
time = 4.39, size = 321, normalized size = 2.89 \begin {gather*} \frac {a^{3} b + a^{2} b^{2} + a b^{3} + b^{4} + {\left (a^{4} + a^{3} b - a b^{3} - b^{4}\right )} \cos \left (f x + e\right )^{2} - {\left ({\left (3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (f x + e\right )^{4} - 3 \, a b^{3} - b^{4} - {\left (3 \, a^{2} b^{2} - 2 \, a b^{3} - b^{4}\right )} \cos \left (f x + e\right )^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) - 2 \, {\left ({\left (a^{4} + 3 \, a^{3} b\right )} \cos \left (f x + e\right )^{4} - a^{3} b - 3 \, a^{2} b^{2} - {\left (a^{4} + 2 \, a^{3} b - 3 \, a^{2} b^{2}\right )} \cos \left (f x + e\right )^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (f x + e\right )\right )}{2 \, {\left ({\left (a^{6} + 3 \, a^{5} b + 3 \, a^{4} b^{2} + a^{3} b^{3}\right )} f \cos \left (f x + e\right )^{4} - {\left (a^{6} + 2 \, a^{5} b - 2 \, a^{3} b^{3} - a^{2} b^{4}\right )} f \cos \left (f x + e\right )^{2} - {\left (a^{5} b + 3 \, a^{4} b^{2} + 3 \, a^{3} b^{3} + a^{2} b^{4}\right )} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{3}{\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 811 vs.
\(2 (105) = 210\).
time = 0.59, size = 811, normalized size = 7.31 \begin {gather*} -\frac {\frac {12 \, {\left (3 \, a b^{2} + b^{3}\right )} \log \left (a + b + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {2 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3}} + \frac {12 \, {\left (a + 3 \, b\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}} - \frac {3 \, a^{4} + 6 \, a^{3} b + 3 \, a^{2} b^{2} + \frac {10 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {16 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {30 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {32 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {8 \, b^{4} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {11 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {22 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {27 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {16 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {16 \, b^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {4 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {16 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {36 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {32 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {8 \, b^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{{\left (a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3}\right )} {\left (\frac {a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {2 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {b {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}} - \frac {3 \, {\left (\cos \left (f x + e\right ) - 1\right )}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}} - \frac {24 \, \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right )}{a^{2}}}{24 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.05, size = 160, normalized size = 1.44 \begin {gather*} \frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,a^2\,f}-\frac {\frac {1}{2\,\left (a+b\right )}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a\,b-b^2\right )}{2\,a\,{\left (a+b\right )}^2}}{f\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^4+\left (a+b\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a+3\,b\right )}{f\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}-\frac {b^2\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )\,\left (3\,a+b\right )}{2\,a^2\,f\,{\left (a+b\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________